<?php

declare(strict_types=1);

namespace App\CustHub\Request;

use Mine\MineFormRequest;

class SmartTagRequest extends MineFormRequest
{
    /**
     * 公共规则.
     */
    public function commonRules(): array
    {
        return [];
    }

    /**
     * 新增数据验证规则
     * return array.
     */
    public function getTagListRules(): array
    {
        return [
            'module' => 'required',
        ];
    }

    public function saveRules(): array
    {
        return [
            'module' => 'required',
            'name' => 'required',
            'sub_type' => 'required_if:module,1|in:0,1',
            'tags' => 'required|array'
        ];
    }

    public function updateRules(): array
    {
        return [
            'id' => 'required',
            'name' => 'required',
        ];
    }

    public function batchSaveTagRules(): array
    {
        return [
            'group_id' => 'required',
            'tags' => 'required|array'
        ];
    }

    public function deleteTagGroupRules(): array
    {
        return [
            'id' => 'required',
        ];
    }

    public function batchDeleteTagRules(): array
    {
        return [
            'ids' => 'required|array',
        ];
    }

    public function sortRules(): array
    {
        return [
            'id' => 'required',
        ];
    }

    public function addContactRules(): array
    {
        return [
            'id' => 'required',
            'contact_ids' => 'required'
        ];
    }

    public function delContactRules(): array
    {
        return [
            'id' => 'required',
            'contact_ids' => 'required'
        ];
    }

    public function moveContactRules(): array
    {
        return [
            'remove_id' => 'required',
            'contact_ids' => 'required',
            'move_tag_ids' => 'required'
        ];
    }

    public function getContactStatsRules()
    {
        return [
            'tag_id' => 'required'
        ];
    }

    public function exportContactStatsRules()
    {
        return [
            'tag_id' => 'required'
        ];
    }

    public function getTagProportionDataRules()
    {
        return [
            'tag_group_id' => 'required'
        ];
    }

    public function getYesterdayComparisonDataRules()
    {
        return [
            'tag_group_id' => 'required'
        ];
    }

    public function getDailyStatsRules()
    {
        return [
            'tag_group_id' => 'required'
        ];
    }

    public function exportRules()
    {
        return [
            'tag_group_id' => 'required'
        ];
    }

    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'group_id' => '分组ID',
            'name' => '分组名称',
            'sub_type' => '行为标签类型',
            'tags' => '标签'
        ];
    }
}